#ifndef INTERVAL_H
#define INTERVAL_H

class interval {
public:
    double min, max;
    interval() : min(+infinity), max(-infinity) {}
    interval(double min, double max) : min(min), max(max) {}
    double size() const {
        return max - min;
    }
    bool contains(double x) const {
        return x >= min && x <= max;
    }
    bool surrounds(double x) const {
        return min <= x && x <= max;
    }
    static const interval empty, universe;//写下面编译不过去，这两个静态变量防止多次编译塞到.cpp里了
};

#endif // INTERVAL_H
